<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8" />
        <title>事件处理</title>
        <script type="text/javascript" src="../js/vue.js"></script>
    </head>
    <body>
        <!-- 准备好一个容器-->
        <div id="root">
            <h1>欢迎来到{{school}}学习</h1>
            <br>
            <button v-on:click="show1">点我提示信息1(v-on)</button>
            <br>
            <br>
            <button @click="show2($event,'小牛马')">点我提示信息2(@click)</button><br>
            <br>
            <br>
        </div>
    </body>
        <script type="text/javascript">
            Vue.config.productionTip = false
            new Vue({
                el:'#root',
                data:{
                    school:'尚硅谷',
                },
                methods:{
                    show1(){
                        alert('信息1')
                    },
                    show2(event,content){
                        console.log(event)  
                        console.log(content)
                        alert('信息2')
                    }
                }
            })
        </script>
</html>